﻿<!-- #Include File="Function.asp" -->
<!-- #Include File="FileSys.asp" -->
<%
'// 用户IP信息
Dim User_Ip
	User_Ip = Ip_Sys(0)

'// 网站是否开启
Call GongXiang_IsOpen()

'// 网站设置时间是否开启
Call GongXiang_TimOpen()

'// 用户 IP 是否被锁定
Call Web_Ip_Shield()

'//* 处理网站关闭信息 *//
Private Function GongXiang_IsOpen()
	If Int(IsOpen) = False Then
		Format_Redirect(InstallDir & "Include/Error.asp?Action=WebClose")
	End If
End Function

Private Sub GongXiang_TimOpen()
	dim Tim_Open,Now_Time
	Tim_Open = Web_TimOpen
	Now_Time=hour(now())
	if Int(Mid(Tim_Open,Now_Time+1,1))=1 Then
		Format_Redirect(InstallDir & "Include/Error.asp?Action=WebClose")
	End If
End Sub

'//* 处理用户IP锁定信息 *//
Private Function Web_Ip_Shield()
	Dim tmp,i
	tmp=True
	If Is_Null(Web_LockIP) = "" Or User_Ip="" Then Exit Function
	Dim sdim,snum
	sdim=Split(Web_LockIP,"|")
	snum=Ubound(sdim)
	For i=0 To snum
		If Instr("$"&User_Ip&".","$"&sdim(i)&".")>0 Then
			Erase sdim
			Format_Redirect(InstallDir & "Include/Error.asp?Action=Error&Text="&Server.UrlEncode("对不起，您的IP地址 "&Request.ServerVariables("REMOTE_ADDR")&" 已封锁!"))
		End If
	Next
	Erase sdim
End Function
%>